/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.gov.mtc.dgac.licencias.bean;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author German
 */
@Entity
@Table(name = "EVALUACIONHABILITACION")
@NamedQueries({@NamedQuery(name = "EvaluacionhabilitacionTO.findByCodEvalHab", query = "SELECT e FROM EvaluacionhabilitacionTO e WHERE e.codEvalHab = :codEvalHab"), @NamedQuery(name = "EvaluacionhabilitacionTO.findByDescripcion", query = "SELECT e FROM EvaluacionhabilitacionTO e WHERE e.descripcion = :descripcion")})
public class EvaluacionhabilitacionTO implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "COD_EVAL_HAB", nullable = false)
    private long codEvalHab;
    @Column(name = "DESCRIPCION", nullable = false)
    private String descripcion;
    @JoinTable(name = "HABILITACIONEVAL", joinColumns = {@JoinColumn(name = "COD_EVAL_HAB", referencedColumnName = "COD_EVAL_HAB")}, inverseJoinColumns = {@JoinColumn(name = "COD_HABILITACION", referencedColumnName = "COD_HABILITACION")})
    @ManyToMany
    private Collection<HabilitacionTO> codHabilitacionCollection;

    public EvaluacionhabilitacionTO() {
    }

    public EvaluacionhabilitacionTO(Long codEvalHab) {
        this.codEvalHab = codEvalHab;
    }

    public EvaluacionhabilitacionTO(Long codEvalHab, String descripcion) {
        this.codEvalHab = codEvalHab;
        this.descripcion = descripcion;
    }

    public long getCodEvalHab() {
        return codEvalHab;
    }

    public void setCodEvalHab(long codEvalHab) {
        this.codEvalHab = codEvalHab;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public Collection<HabilitacionTO> getCodHabilitacionCollection() {
        return codHabilitacionCollection;
    }

    public void setCodHabilitacionCollection(Collection<HabilitacionTO> codHabilitacionCollection) {
        this.codHabilitacionCollection = codHabilitacionCollection;
    }


    @Override
    public String toString() {
        return "com.dgac.licencias.to.EvaluacionhabilitacionTO[codEvalHab=" + codEvalHab + "]";
    }

}
